//
// Created by user on 20-4-16.
//

#ifndef _SMP_H_
#define _SMP_H_

#include "../GeneralLibrary/Printf.h"
#include "../ExceptionManagement/Gate.h"
#include "../InterruptManagement/Interrupt.h"
#include "Cpu.h"
#include "ProcessSync/Spinlock.h"
#include "Task.h"

// 获取到当前　CPU　的 ID
#define SMPCPUID()	(current->cpuID)

extern unsigned char APUBootStart[];
extern unsigned char APUBootEnd[];
extern int globalAPUNumber;

extern Task * initTask[NR_CPUS];

/**
 * 初始化SMP
 */
void SMPInit();

/**
 * AP处理器执行的，相当于BSP的内核开始函数StartKernel
 */
void StartSMP();

void IPI_0x200(unsigned long nr, unsigned long parameter, PerformSite *regs);

#endif //_SMP_H_
